package com.kairos.utils 
{

	/**
	 * @author Cedric Nehemie
	 */
	public class MonitorColorUtils 
	{
		static private const COLOR_TABLE : Array = [
													0xff9988dd, 
													0xffff99ff,
													0xffffccff,
													0xffea6645,
													0xfff8b356,
													0xffffff99,
													0xffb9d065,
													0xff84d0f0,
													0xff60b8e0,
													0xff40b8f0,
													0xff307b9c
													];
		
		static private var INDEX : Number = -1;
		
		static public function get() : Number
		{
			return ++INDEX < COLOR_TABLE.length ? COLOR_TABLE[ INDEX ] : randomColor();
		}
		
		static public function print () : String
		{
			var l : Number = COLOR_TABLE.length;
			var s : String = "";
			for( var i : Number = 0 ; i < l ; i++ )
			{
				s += "0x" + COLOR_TABLE[ i ].toString( 16 ).substr( 2 );
				
				if( i != l - 1 )
					s += "\n";
			}
			
			return s;
		}

		private static function randomColor () : Number
		{
			var a : Number = 255;
			var r : Number = Math.floor( Math.random() * 255 );			var g : Number = Math.floor( Math.random() * 255 );			var b : Number = Math.floor( Math.random() * 255 );
			
			return ( a << 24 ) + ( r << 16 ) + ( g << 8 ) + b;
		}
	}
}
